Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

256
Visualizações
What is the name of the unit test naming convention that is prefixed with "#" and "." in the test names?

I've seen some tests written this way and I would like to know if anyone knows what is the name of this convention:

describe("users/domains/services/user-service", () => {
  describe("UserService", () => {
    describe(".create()", () => {
      ...
    });

   describe(".update()", () => {
      ...
   });
    
    // Static method
    describe("#new()", () => {
      ...
    });
  });
});

If someone can help me I would be very grateful.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This way of referring to a method or variable comes from jsdoc and is called a namepath. For example, MyClass#myMethod could be used in a doc comment to refer the method named #myMethod in the class named MyClass.

The use of this convention for JavaScript tests is very prominent in the mocha.js documentation. An equivalent style has also been proposed by betterspecs.org as a best practice in Ruby, and there's some discussion about it there. I don't know who first adopted the style, and I don't think it has a name.

There's some more relevant answers in this related StackOverflow question.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda